
<?php 
// echo $this->js->ajax("ok","/mvc/blog/create");
$this->layout = '~/views/shared/_defaultLayout.php';
?>
<script type="text/javascript">
  $(document).ready(function() {
    var max_fields      = 10; //maximum input boxes allowed
    var wrapper         = $(".input_fields_wrap"); //Fields wrapper
    var add_button      = $(".add_field_button"); //Add button ID
   
    var x = 1; //initlal text box count
    $(add_button).click(function(e){ //on add input button click
        e.preventDefault();
        if(x < max_fields){ //max input box allowed
            x++; //text box increment
            $(add_button).before('<div class="heelo"><input type="text" class="form-control form1" name="mytext[]"placeholder="Add Subject Name/code" /><a href="#" class="remove_field">Remove</a></div>'); //add input box
        }
    });
   
    $(wrapper).on("click",".remove_field", function(e){ //user click on remove text
        e.preventDefault(); $(this).parent('div').remove(); x--;
    })
});
</script>
<div class="block bgWhite">
	<div class="content"><div id='bloglist'></div></div>
</div>

<div class="block bgWhite">
	<div class="content">
		<img src="http://catalizt.com/wp-content/uploads/2013/07/blog-banner.jpg" width="990" alt="" />
	</div>
	<div class="content">
		<!-- Stack the columns on mobile by making one full-width and the other half-width -->
<div class="row header_row">
<?php 	
					$unserialize_meta=unserialize($underGrade['meta_value']);
					// echo "<pre>";print_r($underGrade);echo "</pre>";
                    foreach($error as $error){
                        echo $error;
                    } 
                ?>
 
  <div class="col-xs-6 col-md-4 interest"><h2>Interest</h2></div>
  <div class="col-xs-6 col-md-4">
    <div class="radio radio_row">
          <label><input type="radio" name="optradio">Learn</label>
        </div>
        <div class="col-xs-6 col-md-4">
        <div class="radio radio_row">
          <label><input type="radio" name="optradio">Teach</label>
        </div>
        </div>
    
</div>
</div>  		<?php echo $chk; ?>
			<div class="row">
     <script type="text/javascript">
      //            function validateForm() {
      //            var x = document.forms["myForm"].value;
      //            if (x==null || x=="") {
      //                $("p").show();
      //                return false;
      //            }
      //       }
      // </script>
 				<form action="" method="post" name="myForm" onsubmit="return validateForm()">
                <p class="ptag">All Feilds are requried</p>
 				<div class="col-xs-6 col-md-4">Under Grade</div>
  			<div class="col-xs-12 col-sm-6 col-md-4">
  				<input type="text" name="school_board" class="form-control form1" placeholder="Add School Board Name" id="mytext"  value="<?php echo (isset($unserialize_meta['school_board'])) ? $unserialize_meta['school_board']:null ?>" />
          <?php echo $err['school_board']; ?>
  				<input type="text" name="school_name" class="form-control form1" placeholder="Add School Name" id="mytext"  value="<?php echo (isset($unserialize_meta['school_name'])) ? $unserialize_meta['school_name']:null ?>"  />
          <?php echo $err['school_name']; ?>
  				<?php foreach($getClasses as $item){
  				if (in_array($item['id'],unserialize($underGrade['meta_value']))) {
						$val = "checked='checked'";
					}	else{
						$val = "";
					} 
  					?>
  				<div class="checkbox">
  					<label>
  						<input type="radio" <?php echo $val; ?> name="class" value ="<?php echo (isset($unserialize_meta['class'])) ? $unserialize_meta['class']:null ?>"><?php echo $item['class']; ?>

  					</label>
  				</div>
  				<?php } ?>
  				<?php for($i=0;$i < 2;$i++){ 
    				?>
    			<div class="checkbox">
			      <label>
			        <input type="radio" name="sem_name"><?php echo $getsemesters[$i]['sem_name']; ?>
			      </label>
    			</div>
    			<?php } ?>
  			</div>
  			<div class="col-xs-12 col-md-4">

							<?php foreach($getSubjects as $item){ 
								if (in_array($item['id'],unserialize($underGrade['meta_value']))) {
										$val = "checked='checked'";
									}	else{
										$val = "";
									}


								?>

							<div class="checkbox">
			      <label>

			        <input type="checkbox" <?php echo $val; ?> name="name[]" value="<?php echo $item['id'] ?>"> <?php echo $item['name']; ?>
			      </label>
    			</div>
							<?php } ?>
<input type="hidden" name="user_id" value="1" />
			        <input type="hidden" name="meta_key" value="meta_key" />
			        <input type="hidden" name="id" value="<?php echo (isset($underGrade['id'])) ? $underGrade['id']:null ?>" />
            </div>
            <input type="submit" name="usersubmit" class="btn btn-primary " value="Save"  />
                    </form>
		</div>

</div>